const BASE_URL = 'http://192.168.8.122:8081'
// const BASE_URL = 'http://112.74.173.230:8081'
export const myRequest = (options)=>{
	return new Promise((resolve,reject)=>{
		uni.request({
			url: BASE_URL+options.url,
			method: options.method || 'GET',
			data: options.data || {},
			success:(res)=>{
				if(res.data.returnCode !== 0){
					return uni.showToast({
						title: res.data.returnMessage,
						icon: 'none'
					})
				}
				resolve(res)
			},
			fail: (err)=>{
				uni.showToast({
					title: '请求接口失败',
					mask:false,
					icon: 'none'
					
				})
				reject(err)
			}
			
		})
	})
}
